import { NPrefab, NPrefabInfo } from "../ngame/sync/state/NSyncStateServer";
import { UIBase, ViewInfo, ViewShowAnim, ViewType } from "../ngame/ui/UIBase";
import { ISceneController } from "./controller/scene/ISceneController";
import { TouchsManage } from "./manage/TouchsManage";

export class UI_VIEW {

    static POPUP:UIBase = null; //UI 弹窗

}

export class UIConfig {

    static BackPack:ViewInfo = {
        name:"BackPack",
        resPath:"prefab/UIView/背包弹窗",
        anim:ViewShowAnim.zoom,
    }

    static Tips:ViewInfo = {
        name:"Tips",
        resPath:"prefab/UIView/提示框",
        viewType:ViewType.Tips,
        viewTypeInfo:{
            isMove:true,
        }
    }

}

export default class GameConst {
    static IsEditor:boolean = true;
    static TOUCHS_MANAGE:TouchsManage = null;
    static I_SCENE:ISceneController = null;
    static TOUCH = {
        TOUCH_WORLD_CLICK:"TOUCH_WORLD_CLICK", //点击场景
        TOUCH_WORLD_WHEEL:"TOUCH_WORLD_WHEEL", //触碰场景
        TOUCH_WORLD_MOVE:"TOUCH_WORLD_MOVE",   //移动场景

        TOUCH_WORLD_CLICK_OBJECT:"TOUCH_WORLD_CLICK_OBJECT", //点击场景 - 物体
        TOUCH_WORLD_CLICK_FLOOR:"TOUCH_WORLD_CLICK_FLOOR", //点击场景 - 地面

    }

    static UI_TOUCH = {
        CLICK_RECRUIT : "CLICK_RECRUIT", //点击招募士兵
        CLICK_ATTACK : "CLICK_ATTACK", //点击攻击
    }

    //玩家ID
    static USER_ID = null;

    static IS_USER_ID = true;

    static getUserId(){
        return this.IS_USER_ID ? this.USER_ID : "123456";
    }
}

export const enum NPrefabKeys {

    玩家,木材,树木

}

/**
 * 网络Prefab
 */
export const NPrefabConst: NPrefab[] = [];
NPrefabConst[NPrefabKeys.玩家] = new NPrefab(
    {
        key:NPrefabKeys.玩家,
        image:"ui/玩家/1/A1/spriteFrame",
        path:"prefab/角色/军官/玩家1"
    }
);
NPrefabConst[NPrefabKeys.木材] = new NPrefab(
    {
        key:NPrefabKeys.木材,
        image:"ui/树木/木材/wood_carried_1.1/spriteFrame",
        path:"prefab/树木/木材/木材"
    }
);
NPrefabConst[NPrefabKeys.树木] = new NPrefab(
    {
        key:NPrefabKeys.树木,
        image:"ui/树木/树木1/spriteFrame",
        path:"prefab/树木/树木"
    }
);

export interface SynthInfo{
    synths:{id:number,num:number}[],//合成列表ID
    result:number,//结果
}
//合成列表
export const Synths:SynthInfo[] = [
    { //合成树木
        synths:[{
            id:NPrefabKeys.木材,
            num:2
        }],
        result:NPrefabKeys.树木,
    },
];


